﻿using System;
using System.Windows.Forms;
using TestsModel.Enums;

namespace TestContentTool.TestControls.InputTest
{
    public partial class InputTestControl : UserControl, IIdentifiableTestControl
    {
        private string id = Guid.NewGuid().ToString();
        public string Id { get { return id; } }
        public TestTypes TestType { get { return TestTypes.RadioTest; } }
        public string Display { get { return inputTestQestionTextBox.Text; } }

        private TestsModel.Data.InputTest inputTest;

        public InputTestControl(TestsModel.Data.InputTest test)
        {
            InitializeComponent();
            if (test == null)
                throw new ArgumentNullException();

            inputTest = test;
            Initialize();
        }

        private void Initialize()
        {
            inputTestQestionTextBox.Text = inputTest.QuestionText;
            inputTestAnswerTextBox.Text = inputTest.Answer;
        }
    }
}
